%%{init: {'themeVariables': { 'fontSize': '12px'}}}%%
graph TD
    classDef path fill:#eee,stroke:#000,color:#000
    classDef plan fill:#fff,stroke-width:1px,color:#000
    classDef itemplan fill:#fff,stroke-width:2px,color:#000
    classDef unbatchedplan fill:#dff,stroke-width:1px,color:#000
    classDef sideeffectplan fill:#fcc,stroke-width:2px,color:#000
    classDef bucket fill:#f6f6f6,color:#000,stroke-width:2px,text-align:left

    subgraph "Buckets for queries/v4/arrays"
    Bucket0("Bucket 0 (root)<br /><br />1: 65, 69<br />ᐳ: 8, 9, 28, 32, 10<br />2: PgSelect[7]<br />ᐳ: Access[66], Access[70]<br />3: PgSelectRows[11]"):::bucket
    Bucket1("Bucket 1 (listItem)<br />Deps: 66, 70<br /><br />ROOT __Item{1}ᐸ11ᐳ[12]<br />1: <br />ᐳ: 13, 67, 71, 14, 15, 16, 17, 18, 19, 20, 21, 22, 33, 34, 68, 72<br />2: PgSelectRows[35], PgSelectRows[36]"):::bucket
    Bucket2("Bucket 2 (listItem)<br /><br />ROOT __Item{2}ᐸ15ᐳ[37]"):::bucket
    Bucket3("Bucket 3 (listItem)<br /><br />ROOT __Item{3}ᐸ16ᐳ[38]"):::bucket
    Bucket4("Bucket 4 (listItem)<br /><br />ROOT __Item{4}ᐸ17ᐳ[39]"):::bucket
    Bucket5("Bucket 5 (listItem)<br /><br />ROOT __Item{5}ᐸ18ᐳ[40]"):::bucket
    Bucket6("Bucket 6 (listItem)<br /><br />ROOT __Item{6}ᐸ19ᐳ[41]"):::bucket
    Bucket7("Bucket 7 (listItem)<br /><br />ROOT __Item{7}ᐸ20ᐳ[42]"):::bucket
    Bucket8("Bucket 8 (listItem)<br /><br />ROOT __Item{8}ᐸ21ᐳ[43]"):::bucket
    Bucket9("Bucket 9 (listItem)<br /><br />ROOT __Item{9}ᐸ22ᐳ[44]"):::bucket
    Bucket10("Bucket 10 (listItem)<br /><br />ROOT __Item{10}ᐸ35ᐳ[45]"):::bucket
    Bucket11("Bucket 11 (listItem)<br /><br />ROOT __Item{11}ᐸ36ᐳ[47]"):::bucket
    Bucket12("Bucket 12 (listItem)<br /><br />ROOT __Item{12}ᐸ33ᐳ[49]"):::bucket
    Bucket13("Bucket 13 (listItem)<br /><br />ROOT __Item{13}ᐸ34ᐳ[50]"):::bucket
    Bucket14("Bucket 14 (nullableBoundary)<br />Deps: 46<br /><br />ROOT PgSelectSingle{10}ᐸfrmcdc_compoundTypeᐳ[46]"):::bucket
    Bucket15("Bucket 15 (nullableBoundary)<br />Deps: 48<br /><br />ROOT PgSelectSingle{11}ᐸfrmcdc_compoundTypeᐳ[48]"):::bucket
    end
    Bucket0 --> Bucket1
    Bucket1 --> Bucket2 & Bucket3 & Bucket4 & Bucket5 & Bucket6 & Bucket7 & Bucket8 & Bucket9 & Bucket10 & Bucket11 & Bucket12 & Bucket13
    Bucket10 --> Bucket14
    Bucket11 --> Bucket15

    %% plan dependencies
    PgSelect7[["PgSelect[7∈0] ➊<br />ᐸlistsᐳ"]]:::plan
    Object10{{"Object[10∈0] ➊<br />ᐸ{pgSettings,withPgClient}ᐳ"}}:::plan
    PgFromExpression28{{"PgFromExpression[28∈0] ➊"}}:::plan
    PgSelectInlineApply65["PgSelectInlineApply[65∈0] ➊"]:::plan
    PgFromExpression32{{"PgFromExpression[32∈0] ➊"}}:::plan
    PgSelectInlineApply69["PgSelectInlineApply[69∈0] ➊"]:::plan
    Object10 & PgFromExpression28 & PgSelectInlineApply65 & PgFromExpression32 & PgSelectInlineApply69 --> PgSelect7
    Access8{{"Access[8∈0] ➊<br />ᐸ2.pgSettingsᐳ"}}:::plan
    Access9{{"Access[9∈0] ➊<br />ᐸ2.withPgClientᐳ"}}:::plan
    Access8 & Access9 --> Object10
    __Value2["__Value[2∈0] ➊<br />ᐸcontextᐳ"]:::plan
    __Value2 --> Access8
    __Value2 --> Access9
    PgSelectRows11[["PgSelectRows[11∈0] ➊"]]:::plan
    PgSelect7 --> PgSelectRows11
    Access66{{"Access[66∈0] ➊<br />ᐸ7.m.subqueryDetailsFor24ᐳ"}}:::plan
    PgSelect7 --> Access66
    Access70{{"Access[70∈0] ➊<br />ᐸ7.m.subqueryDetailsFor30ᐳ"}}:::plan
    PgSelect7 --> Access70
    List67{{"List[67∈1]<br />ᐸ66,12ᐳ"}}:::plan
    __Item12[/"__Item[12∈1]<br />ᐸ11ᐳ"\]:::itemplan
    Access66 & __Item12 --> List67
    List71{{"List[71∈1]<br />ᐸ70,12ᐳ"}}:::plan
    Access70 & __Item12 --> List71
    PgSelectRows11 ==> __Item12
    PgSelectSingle13{{"PgSelectSingle[13∈1]<br />ᐸlistsᐳ"}}:::plan
    __Item12 --> PgSelectSingle13
    PgClassExpression14{{"PgClassExpression[14∈1]<br />ᐸ__lists__.”id”ᐳ"}}:::plan
    PgSelectSingle13 --> PgClassExpression14
    PgClassExpression15{{"PgClassExpression[15∈1]<br />ᐸ__lists__.”int_array”ᐳ"}}:::plan
    PgSelectSingle13 --> PgClassExpression15
    PgClassExpression16{{"PgClassExpression[16∈1]<br />ᐸ__lists__...._array_nn”ᐳ"}}:::plan
    PgSelectSingle13 --> PgClassExpression16
    PgClassExpression17{{"PgClassExpression[17∈1]<br />ᐸ__lists__.”enum_array”ᐳ"}}:::plan
    PgSelectSingle13 --> PgClassExpression17
    PgClassExpression18{{"PgClassExpression[18∈1]<br />ᐸ__lists__...._array_nn”ᐳ"}}:::plan
    PgSelectSingle13 --> PgClassExpression18
    PgClassExpression19{{"PgClassExpression[19∈1]<br />ᐸ__lists__.”date_array”ᐳ"}}:::plan
    PgSelectSingle13 --> PgClassExpression19
    PgClassExpression20{{"PgClassExpression[20∈1]<br />ᐸ__lists__...._array_nn”ᐳ"}}:::plan
    PgSelectSingle13 --> PgClassExpression20
    PgClassExpression21{{"PgClassExpression[21∈1]<br />ᐸ__lists__....ptz_array”ᐳ"}}:::plan
    PgSelectSingle13 --> PgClassExpression21
    PgClassExpression22{{"PgClassExpression[22∈1]<br />ᐸ__lists__...._array_nn”ᐳ"}}:::plan
    PgSelectSingle13 --> PgClassExpression22
    PgClassExpression33{{"PgClassExpression[33∈1]<br />ᐸ__lists__.”bytea_array”ᐳ"}}:::plan
    PgSelectSingle13 --> PgClassExpression33
    PgClassExpression34{{"PgClassExpression[34∈1]<br />ᐸ__lists__...._array_nn”ᐳ"}}:::plan
    PgSelectSingle13 --> PgClassExpression34
    PgSelectRows35[["PgSelectRows[35∈1]"]]:::plan
    Lambda68{{"Lambda[68∈1]<br />ᐸpgInlineViaSubqueryTransformᐳ"}}:::plan
    Lambda68 --> PgSelectRows35
    PgSelectRows36[["PgSelectRows[36∈1]"]]:::plan
    Lambda72{{"Lambda[72∈1]<br />ᐸpgInlineViaSubqueryTransformᐳ"}}:::plan
    Lambda72 --> PgSelectRows36
    List67 --> Lambda68
    List71 --> Lambda72
    __Item37[/"__Item[37∈2]<br />ᐸ15ᐳ"\]:::itemplan
    PgClassExpression15 ==> __Item37
    __Item38[/"__Item[38∈3]<br />ᐸ16ᐳ"\]:::itemplan
    PgClassExpression16 ==> __Item38
    __Item39[/"__Item[39∈4]<br />ᐸ17ᐳ"\]:::itemplan
    PgClassExpression17 ==> __Item39
    __Item40[/"__Item[40∈5]<br />ᐸ18ᐳ"\]:::itemplan
    PgClassExpression18 ==> __Item40
    __Item41[/"__Item[41∈6]<br />ᐸ19ᐳ"\]:::itemplan
    PgClassExpression19 ==> __Item41
    __Item42[/"__Item[42∈7]<br />ᐸ20ᐳ"\]:::itemplan
    PgClassExpression20 ==> __Item42
    __Item43[/"__Item[43∈8]<br />ᐸ21ᐳ"\]:::itemplan
    PgClassExpression21 ==> __Item43
    __Item44[/"__Item[44∈9]<br />ᐸ22ᐳ"\]:::itemplan
    PgClassExpression22 ==> __Item44
    __Item45[/"__Item[45∈10]<br />ᐸ35ᐳ"\]:::itemplan
    PgSelectRows35 ==> __Item45
    PgSelectSingle46{{"PgSelectSingle[46∈10]<br />ᐸfrmcdc_compoundTypeᐳ"}}:::plan
    __Item45 --> PgSelectSingle46
    __Item47[/"__Item[47∈11]<br />ᐸ36ᐳ"\]:::itemplan
    PgSelectRows36 ==> __Item47
    PgSelectSingle48{{"PgSelectSingle[48∈11]<br />ᐸfrmcdc_compoundTypeᐳ"}}:::plan
    __Item47 --> PgSelectSingle48
    __Item49[/"__Item[49∈12]<br />ᐸ33ᐳ"\]:::itemplan
    PgClassExpression33 ==> __Item49
    __Item50[/"__Item[50∈13]<br />ᐸ34ᐳ"\]:::itemplan
    PgClassExpression34 ==> __Item50
    PgClassExpression51{{"PgClassExpression[51∈14]<br />ᐸ__frmcdc_c...type__.”a”ᐳ"}}:::plan
    PgSelectSingle46 --> PgClassExpression51
    PgClassExpression53{{"PgClassExpression[53∈14]<br />ᐸ__frmcdc_c...type__.”b”ᐳ"}}:::plan
    PgClassExpression51 o--o PgClassExpression53
    PgClassExpression55{{"PgClassExpression[55∈14]<br />ᐸ__frmcdc_c...type__.”c”ᐳ"}}:::plan
    PgClassExpression53 o--o PgClassExpression55
    PgClassExpression57{{"PgClassExpression[57∈14]<br />ᐸ__frmcdc_c...type__.”d”ᐳ"}}:::plan
    PgClassExpression55 o--o PgClassExpression57
    PgClassExpression59{{"PgClassExpression[59∈14]<br />ᐸ__frmcdc_c...type__.”e”ᐳ"}}:::plan
    PgClassExpression57 o--o PgClassExpression59
    PgClassExpression61{{"PgClassExpression[61∈14]<br />ᐸ__frmcdc_c...type__.”f”ᐳ"}}:::plan
    PgClassExpression59 o--o PgClassExpression61
    PgClassExpression63{{"PgClassExpression[63∈14]<br />ᐸ__frmcdc_c....”foo_bar”ᐳ"}}:::plan
    PgClassExpression61 o--o PgClassExpression63
    PgClassExpression52{{"PgClassExpression[52∈15]<br />ᐸ__frmcdc_c...type__.”a”ᐳ"}}:::plan
    PgSelectSingle48 --> PgClassExpression52
    PgClassExpression54{{"PgClassExpression[54∈15]<br />ᐸ__frmcdc_c...type__.”b”ᐳ"}}:::plan
    PgClassExpression52 o--o PgClassExpression54
    PgClassExpression56{{"PgClassExpression[56∈15]<br />ᐸ__frmcdc_c...type__.”c”ᐳ"}}:::plan
    PgClassExpression54 o--o PgClassExpression56
    PgClassExpression58{{"PgClassExpression[58∈15]<br />ᐸ__frmcdc_c...type__.”d”ᐳ"}}:::plan
    PgClassExpression56 o--o PgClassExpression58
    PgClassExpression60{{"PgClassExpression[60∈15]<br />ᐸ__frmcdc_c...type__.”e”ᐳ"}}:::plan
    PgClassExpression58 o--o PgClassExpression60
    PgClassExpression62{{"PgClassExpression[62∈15]<br />ᐸ__frmcdc_c...type__.”f”ᐳ"}}:::plan
    PgClassExpression60 o--o PgClassExpression62
    PgClassExpression64{{"PgClassExpression[64∈15]<br />ᐸ__frmcdc_c....”foo_bar”ᐳ"}}:::plan
    PgClassExpression62 o--o PgClassExpression64

    %% define steps
    classDef bucket0 stroke:#696969
    class Bucket0,__Value2,PgSelect7,Access8,Access9,Object10,PgSelectRows11,PgFromExpression28,PgFromExpression32,PgSelectInlineApply65,Access66,PgSelectInlineApply69,Access70 bucket0
    classDef bucket1 stroke:#00bfff
    class Bucket1,__Item12,PgSelectSingle13,PgClassExpression14,PgClassExpression15,PgClassExpression16,PgClassExpression17,PgClassExpression18,PgClassExpression19,PgClassExpression20,PgClassExpression21,PgClassExpression22,PgClassExpression33,PgClassExpression34,PgSelectRows35,PgSelectRows36,List67,Lambda68,List71,Lambda72 bucket1
    classDef bucket2 stroke:#7f007f
    class Bucket2,__Item37 bucket2
    classDef bucket3 stroke:#ffa500
    class Bucket3,__Item38 bucket3
    classDef bucket4 stroke:#0000ff
    class Bucket4,__Item39 bucket4
    classDef bucket5 stroke:#7fff00
    class Bucket5,__Item40 bucket5
    classDef bucket6 stroke:#ff1493
    class Bucket6,__Item41 bucket6
    classDef bucket7 stroke:#808000
    class Bucket7,__Item42 bucket7
    classDef bucket8 stroke:#dda0dd
    class Bucket8,__Item43 bucket8
    classDef bucket9 stroke:#ff0000
    class Bucket9,__Item44 bucket9
    classDef bucket10 stroke:#ffff00
    class Bucket10,__Item45,PgSelectSingle46 bucket10
    classDef bucket11 stroke:#00ffff
    class Bucket11,__Item47,PgSelectSingle48 bucket11
    classDef bucket12 stroke:#4169e1
    class Bucket12,__Item49 bucket12
    classDef bucket13 stroke:#3cb371
    class Bucket13,__Item50 bucket13
    classDef bucket14 stroke:#a52a2a
    class Bucket14,PgClassExpression51,PgClassExpression53,PgClassExpression55,PgClassExpression57,PgClassExpression59,PgClassExpression61,PgClassExpression63 bucket14
    classDef bucket15 stroke:#ff00ff
    class Bucket15,PgClassExpression52,PgClassExpression54,PgClassExpression56,PgClassExpression58,PgClassExpression60,PgClassExpression62,PgClassExpression64 bucket15

